home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Files / XTND 1.3.6 / Translator Examples / MacWrite Translator / CodeA5Globals.c next >
Encoding:
C/C++ Source or Header  |  1991-04-23  |  1.3 KB  |  56 lines  |  [TEXT/MPS ]

  1. /************************************************************************
  2. *                                                                        *
  3. *    CodeA5Globals.c                                                        *
  4. *                                                                        *
  5. *    A5-world routines for using globals in code resources. For             *
  6. *    details, see Technical Note #256.                                    *
  7. *                                                                        *
  8. *    Copyright © 1988 Claris Corporation                                    *
  9. *    All Rights Reserved                                                    *
  10. *                                                                        *
  11. ************************************************************************/
  12.  
  13. #include <QuickDraw.h>
  14. #include <Memory.h>
  15. #include <OSUtils.h>
  16. #include "CodeA5Globals.h"
  17.  
  18.  
  19. /*----------------------------------------------------------------------*/
  20. void MakeA5World(A5Ref)
  21. register Handle    A5Ref;
  22. {
  23.     SetHandleSize(A5Ref, A5Size());
  24.     MoveHHi(A5Ref);
  25.     HLock(A5Ref);
  26.     A5Init((Ptr)((*A5Ref) + A5Size() - 32));
  27. }
  28.  
  29.  
  30. /*----------------------------------------------------------------------*/
  31. long SetA5World(A5Ref)
  32. register Handle    A5Ref;
  33. {
  34.     return(SetA5((long)(*A5Ref) + A5Size() - 32));
  35. }
  36.  
  37.  
  38. /*----------------------------------------------------------------------*/
  39. void RestoreA5World(oldA5, A5Ref)
  40. register long    oldA5;
  41. register Handle    A5Ref;
  42. {
  43. #    pragma unused(A5Ref)
  44.  
  45.     SetA5(oldA5);
  46. }
  47.  
  48.  
  49. /*----------------------------------------------------------------------*/
  50. void DisposeA5World(A5Ref)
  51. register Handle    A5Ref;
  52. {
  53.     HUnlock(A5Ref);
  54.     DisposHandle(A5Ref);
  55. }
  56.